//
//  GYTopTableViewCell.m
//  fp
//
//  Created by xingshuai on 2020/11/12.
//

#import "GYTopTableViewCell.h"

@interface GYTopTableViewCell ()

@property (nonatomic, strong) UIImageView *iconImg;
@property (nonatomic, strong) UILabel *nameLabel;

@end

@implementation GYTopTableViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView  {
    static NSString *identifier = @"XAGYTypeCellID";
    id cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[self alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self creatViewUI];
    }
    return self;
}

-(void)creatViewUI {
    self.iconImg = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_user"]];
    self.iconImg.layer.cornerRadius = 23;
    self.iconImg.clipsToBounds = YES;
    [self.contentView addSubview:self.iconImg];
    [self.iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.contentView);
        make.size.mas_offset(CGSizeMake(100, 100));
    }];
    
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.text = [NSString stringWithFormat:@"%@  %@",[XSCusObject getAppBundleName],[XSCusObject getAppVersion]];
    self.nameLabel.textColor = [UIColor colorWithHexString:@"#3B3B3B"];
    self.nameLabel.font = [UIFont pingFangSCWithWeight:FontWeightStyleRegular size:16];
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.iconImg);
        make.top.equalTo(self.iconImg.mas_bottom).offset(15);
    }];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
